PROPERTY
Section: Unordered Sequence Classes ()
Updated: June 12 1992
Index
Return to Main Contents
NAME
Property - LISP like property list.
SYNOPSIS
#include <cool/Property.h>
DESCRIPTION
Property implements LISP property list as a dynamic association array
between String and Value. String is used for property name in look up.
Value can store and retrieve void* or primitive types like: char, int,
float, double. Property lists are useful for rapid prototyping
and hacking, when you want to store temporary data with a data structure,
without modifying it at compile-time. Compile-time type checking is replaced
by run-time type checking.
EXAMPLE
#include <cool/Property.h>
void main() {
Property plist;
plist.put("p0", int(1));
plist.put("p1", double(2.5));
plist.put("p2", &plist);
cout << plist << endl;
Value v0, v1, v2;
cout << plist.get("p0", v0) << " ";
cout << plist.get("p1", v1) << " ";
cout << plist.get("p", v2) << " ";
cout << plist.remove("p2") << " ";
}
has output:
[ [p0 (int)1] [p1 (double)2.5] [p2 (void*)0xf7fff204] ]
1 1 0 1
SEE ALSO
Association<KType,VType>, Vector<Type>, Pair<Type1,Type2>
are used to implement a dynamic association array between String and Value.
COPYRIGHT
Copyright (C) 1992 General Electric Company.
Permission is granted to any individual or institution to use, copy, modify,
and distribute this software, provided that this complete copyright and
permission notice is maintained, intact, in all copies and supporting
documentation.
General Electric Company provides this software "as is" without
express or implied warranty.
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- EXAMPLE
-
- SEE ALSO
-
- COPYRIGHT
-
This document was created by
man2html,
using the manual pages.
Time: 00:40:36 GMT, March 30, 2022